﻿<UserControl x:Class="Agnes.TaskManager.TaskSmartTreeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Agnes.TaskManager"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid >
        <Grid.Resources>
            <HierarchicalDataTemplate x:Key="TaskHDT" DataType="{x:Type local:TaskInfo}" ItemsSource="{Binding Path=ChildTasks}">
                <StackPanel Orientation="Horizontal">
                    <Image />
                    <TextBlock Text="{Binding Path=TaskName}" />
                </StackPanel>
            </HierarchicalDataTemplate>
        </Grid.Resources>
        <TreeView Background="AliceBlue" ItemsSource="{Binding Model.TaskRoots}" ItemTemplate="{StaticResource TaskHDT}" />
    </Grid>
</UserControl>
